import 'package:floor/floor.dart';
import 'package:share_fit/app/models/home/weekly_report_model.dart';

@dao
abstract class WeeklyReportDao {
  /// 根据手表mac地址和时间范围查询数据，时间格式为yyyyMMdd -> 20240101
  @Query('select sum(step) as step, sum(calories) as calories, sum(distance) as distance, '
      'max(heart_rate) as heart_rate, sum(sleep_time) as sleep_time '
      'from weekly_report where address = :address and calendar >= :calendarStart and calendar < :calendarEnd')
  Future<WeeklyReportModel?> find(String address, String calendarStart, String calendarEnd);
}